package fun.sssdnsy.media.image;

import org.fxmisc.richtext.model.NodeSegmentOpsBase;


public class LinkedImageOps<S> extends NodeSegmentOpsBase<LinkedImage, S> {

    private final LinkedImage emptyImage;

    public LinkedImageOps() {
        super(new EmptyLinkedImage());
        emptyImage = new EmptyLinkedImage();
    }

    public LinkedImageOps(LinkedImage emptyImage) {
        super(new EmptyLinkedImage());
        this.emptyImage = emptyImage;
    }

    @Override
    public int length(LinkedImage linkedImage) {
        return linkedImage.isReal() ? 1 : 0;
    }

    public LinkedImage getEmptyImage() {
        return emptyImage;
    }
}
